/*
 * CalculatedProperty.java - Copyright May 14, 2012 Z Networks Group, Inc. All rights reserved.
 * Z Networks Group PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.andromeda.skadi.property;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * Una propiedad calculada es una propiedad que depende de otras propiedades
 * para establecer su valor.
 *
 * @author Dickinson Roman Arismendy Torres
 */
public class CalculatedProperty<T> extends Property<T> {

    private transient PropertyCalculator calculator;
    private Set<EncapsulatedProperty> dependentProperties = new HashSet<EncapsulatedProperty>();

    public CalculatedProperty(PropertyCalculator calculator, Set<EncapsulatedProperty> dependentProperties) {
        this.calculator = calculator;
        this.dependentProperties.addAll(dependentProperties);
    }
    public CalculatedProperty(PropertyCalculator calculator, EncapsulatedProperty... dependentProperties) {
        this.calculator = calculator;
        this.dependentProperties.addAll(Arrays.asList(dependentProperties));
    }
    
    private void addListeners(){
        for(EncapsulatedProperty property : dependentProperties){
            addListener(property);
        }
    }

    private void addListener(EncapsulatedProperty property) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    
    
    
}
